public class Test {
    public static void selectSort(int[] array) {
        for (int i = 0; i < array.length; i++) {
            //找最小值
            int index = i;
            for (int j = i + 1; j < array.length; j++) {
                if (array[j] < array[index]) {
                    index = j;
                }
            }
            //交换
            int tmp = array[i];
            array[i] = array[index];
            array[index] = tmp;
        }
    }

    public static void main(String[] args) {
        TestHeap testHeap = new TestHeap();
        int[] array = {27, 15, 19, 18, 28, 34, 65, 49, 25, 37};
        testHeap.initElem(array);
        testHeap.createHeap();
        testHeap.push(100);
        testHeap.push(1000);
        testHeap.push(120);
        System.out.println(testHeap.pop());
        System.out.println(testHeap.getTop());
        testHeap.print();
    }
}














